feat(tags): add stream tags/labels for organization (#727) - #908
feat(tags): add stream tags/labels for organization (#727)#908Chekuyermu wants to merge 1 commit into
Conversation
Closes ritik4ever#727 Overview: This PR adds a tags/labels system for streams, allowing creators to assign up to 5 descriptive tags (e.g., payroll, vesting, grant) for organization and filtering. Changes: [ADD] backend/migrations/005_add_stream_tags.sql - Adds 'tags' TEXT column to streams and stream_archive tables [ADD] backend/migrations/005_add_stream_tags.down.sql - Rollback script for the tags migration [MODIFY] backend/src/services/streamStore.ts - Added 'tags' field to StreamInput, StreamRecord, and StreamRow interfaces - Updated rowToRecord() to parse tags from JSON - Updated upsertStream() to store tags as JSON - Updated createStream() to pass tags from input to record - Updated archiveOldStreams() to persist tags in stream_archive [MODIFY] backend/src/validation/schemas.ts - Added tagsSchema: array of strings, max 5 tags, max 50 chars each - Added optional 'tags' field to createStreamPayloadSchema [MODIFY] backend/src/index.ts - Added 'tag' query parameter to listStreamsQuerySchema - Added tag-based filtering to all 5 stream listing endpoints: GET /api/streams, /api/streams/sender/:address, /api/streams/recipient/:address, /api/recipients/:accountId/streams, /api/senders/:accountId/streams [MODIFY] backend/src/services/migrations.test.ts - Added 'tags' to expected streams columns - Updated rollback test to account for migration 5 Verification Results: ✅ Migrations test: 4/4 passed ✅ Swagger test: 2/2 passed ✅ Validation tests: 40/41 passed (1 pre-existing failure) ✅ TypeScript: no new errors (pre-existing errors unchanged) ✅ All tags feature tests pass Acceptance Criteria: | Criteria | Status | |---|---| | Creator can set up to 5 tags on a stream | ✅ Max 5 enforced via Zod | | GET /api/streams?tag=payroll filters by tag | ✅ Case-insensitive filter | | Tags stored in SQLite array column | ✅ JSON array in TEXT column | | Tag filter works with other filters | ✅ Applies after all other filters | | Max 5 tags enforced | ✅ Zod validation with max(5) | | Tags returned in stream response | ✅ Parsed from DB in rowToRecord |
|
@Chekuyermu is attempting to deploy a commit to the ritik4ever's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Chekuyermu Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Overview
This PR adds a tags/labels system for streams, allowing creators to assign up to 5 descriptive tags (e.g., payroll, vesting, grant) for organization and filtering.
Related Issue
Closes #727
Changes
[ADD]
backend/migrations/005_add_stream_tags.sqltagsTEXT column tostreamsandstream_archivetables[ADD]
backend/migrations/005_add_stream_tags.down.sql[MODIFY]
backend/src/services/streamStore.tstagsfield toStreamInput,StreamRecord, andStreamRowinterfacesrowToRecord()to parse tags from JSONupsertStream()to store tags as JSONcreateStream()to pass tags from input to recordarchiveOldStreams()to persist tags instream_archive[MODIFY]
backend/src/validation/schemas.tstagsSchema: array of strings, max 5 tags, max 50 chars eachtagsfield tocreateStreamPayloadSchema[MODIFY]
backend/src/index.tstagquery parameter tolistStreamsQuerySchemaGET /api/streams?tag=payrollGET /api/streams/sender/:addressGET /api/streams/recipient/:addressGET /api/recipients/:accountId/streamsGET /api/senders/:accountId/streams[MODIFY]
backend/src/services/migrations.test.tstagsto expected streams columnsVerification Results
Acceptance Criteria
GET /api/streams?tag=payrollfilters by tagmax(5)constraintrowToRecord